home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / misc / emu / p-interp.lha / p-interp-0.4 / Memory.h < prev    next >
C/C++ Source or Header  |  2001-05-20  |  1KB  |  49 lines

  1. /*
  2.  
  3.   P-Code interpreter (to run the apple pascal system)
  4.   Copyright (C) 2000 Mario Klebsch
  5.  
  6.   This program is free software; you can redistribute it and/or modify
  7.   it under the terms of the GNU General Public License as published by
  8.   the Free Software Foundation; either version 2 of the License, or
  9.   (at your option) any later version.
  10.  
  11.   This program is distributed in the hope that it will be useful,
  12.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.   GNU General Public License for more details.
  15.  
  16.   You should have received a copy of the GNU General Public License
  17.   along with this program; if not, write to the Free Software
  18.   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  
  20.   $Log: Memory.h,v $
  21.   Revision 1.2  2001/05/20 13:12:02  mario
  22.   CVS-Idents und Logs eingefügt
  23.  
  24.  
  25. */
  26.  
  27.  
  28. #define WORD_MEMORY
  29.  
  30. extern int SwapBytes;
  31.  
  32. byte MemRdByte(word Addr, Integer Offset);
  33. void MemWrByte(word Addr, Integer Offset, byte Value);
  34. word MemRd(word Addr);
  35. void MemWr(word Addr, word Value);
  36. void MemReadOnly(word from, word to, int RO);
  37. void MemDump(FILE *f, word Start, word End);
  38. void MemInit(void);
  39.  
  40. #define NIL        0
  41.  
  42. #define PointerCheck(Pointer) if ((Pointer) == NIL) XeqError(7)
  43.  
  44. #ifdef WORD_MEMORY
  45. #define WordIndexed(Pointer, Offset) ((Pointer) + (Offset))
  46. #else
  47. #define WordIndexed(Pointer, Offset) ((Pointer) + 2*(Offset))
  48. #endif
  49.